﻿using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Windows;

namespace _3WPF应用程序的关闭
{
    /// <summary>
    /// App.xaml 的交互逻辑
    /// </summary>
    public partial class App : Application
    {
        private void Application_Exit(object sender, ExitEventArgs e)
        {
            MessageBox.Show("窗口已销毁，程序正在关闭。。。");
        }

        private void Application_Activated(object sender, EventArgs e)
        {
            //转换为前台程序，即触发此事件
            //MessageBox.Show("现在为前台程序");
        }

        private void Application_Deactivated(object sender, EventArgs e)
        {
            //转换为后台程序，即触发此事件
            //MessageBox.Show("现在为后台程序");
        }
    }
}
